<template>
        <div class="topnav">
            <router-link to="/city" class="city">
                <span v-if="city" :city="city">{{city.nm}}</span>
                <span v-else>广州</span>
                <i></i>
            </router-link>
            <div class="nav-select">
                <router-link to="/"><span class="nav-text">热映</span></router-link>
                <!-- <router-link to="/cinema"><span class="nav-text">影院</span></router-link> -->
                <router-link to="/released"><span class="nav-text">待映</span></router-link>
                <router-link to="/classic"><span class="nav-text">经典电影</span></router-link>
            </div>
            <router-link to="/search" class="search"> </router-link>
        </div>

        <!-- <router-view></router-view> -->

</template>

<script>
import { mapState } from 'vuex'

export default {
    data(){
        return{
            
        }
    },
    created(){
        
    },
    methods:{
    },
    components:{
    },
    computed:{
        ...mapState(["city"])
    }
}
</script>

<style lang="less" scoped>
.topnav{
    width: 100%;
    height: 44px;
    // border-bottom: 2px solid #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 5;
    position: fixed;
    top: 50px;
    left: 0px;
    background: #fff;
    .city{
        padding-left: 15px;
        height: 44px;
        line-height: 44px;
        &>span{
            color: #666;
            font-size: 15px;
        }
        &>i{
            width: 0;
            height: 0;
            border: 4px solid transparent;
            border-top-color: #b0b0b0;
            display: inline-block;
            margin-left: 8px;
            margin-right: 10px;
            margin-top: 10px;
        }
    }
    .nav-select{
        display: flex;
        height: 44px;
        line-height: 44px;
        justify-content: space-around;
        font-size: 15px;
        font-weight: 500;
        z-index: 5;
        height: 44px;
        &>a{
            display: block;
            color: #666;
            padding: 0px 5px;
            box-sizing: border-box;
            width: 50px;
            height: 44px;
            line-height: 44px;
            position: relative;
            text-align: center;
            .nav-text{
                font-size: 15px;
                font-weight: 700;
            }
            &:nth-child(3){
                width: 85px;
            }
            &.router-link-exact-active{
                box-sizing: border-box;
                .nav-text{
                    font-size: 18px;
                    color: black;
                }
                &::after{
                    content: "";
                    position: absolute;
                    left: 50%;
                    bottom: -1px;
                    z-index: 3;
                    width: 20px;
                    height: 3px;
                    border-radius: 0.02rem;
                    transform: scaleY(0.5);
                    background: #dd001b;
                    transform: translateX(-50%);
                }
            }
            &>span{
                display: inline-block;
            }
        }
    }
    .search{
        padding: 10px 15px 10px 10px;
        width: 20px;
        height: 20px;
        background: url("../assets/img/search.png") no-repeat;
        background-size: 20px;
        background-position: 15px;
    }
}
</style>